aboutdialog: Clarify docs and fix preconditions
authorTimm Bäder <mail@baedert.org>
Tue, 18 Feb 2020 09:36:04 +0000 (10:36 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 20 Feb 2020 09:23:09 +0000 (10:23 +0100)
gtk/gtkaboutdialog.c

index 6c1475f1cc8948da6e42016e97945d465d1f70a7..a3457e92436e7833babe91421d57895a9a0c875b 100644 (file)
@@ -584,7 +584,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
     g_param_spec_string ("logo-icon-name",
                          P_("Logo Icon Name"),
                          P_("A named icon to use as the logo for the about box."),
-                         "image-missing",
+                         NULL,
                          GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
@@ -1731,7 +1731,9 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
  *
  * Returns the paintable displayed as logo in the about dialog.
  *
- * Returns: (transfer none): the paintable displayed as logo. The
+ * Returns: (transfer none) (nullable): the paintable displayed as
+ *   logo or %NULL if the logo is unset or has been set via
+ *   gtk_about_dialog_set_logo_icon_name(). The
  *   paintable is owned by the about dialog. If you want to keep a
  *   reference to it, you have to call g_object_ref() on it.
  */
@@ -1753,9 +1755,7 @@ gtk_about_dialog_get_logo (GtkAboutDialog *about)
  * @about: a #GtkAboutDialog
  * @logo: (allow-none): a #GdkPaintable, or %NULL
  *
- * Sets the surface to be displayed as logo in the about dialog.
- * If it is %NULL, the default window icon set with
- * gtk_window_set_default_icon() will be used.
+ * Sets the logo in the about dialog.
  */
 void
 gtk_about_dialog_set_logo (GtkAboutDialog *about,
@@ -1764,15 +1764,14 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
   GtkAboutDialogPrivate *priv = gtk_about_dialog_get_instance_private (about);
 
   g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
-  g_return_if_fail (logo == NULL || GDK_IS_TEXTURE (logo));
+  g_return_if_fail (logo == NULL || GDK_IS_PAINTABLE (logo));
 
   g_object_freeze_notify (G_OBJECT (about));
 
   if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
     g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO_ICON_NAME]);
 
-  if (logo != NULL)
-    gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
+  gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
 
   g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO]);
 
@@ -1785,8 +1784,9 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
  *
  * Returns the icon name displayed as logo in the about dialog.
  *
- * Returns: the icon name displayed as logo. The string is
- *   owned by the dialog. If you want to keep a reference
+ * Returns: (transfer none) (nullable): the icon name displayed as logo or %NULL
+ *   if the logo has been set via gtk_about_dialog_set_logo().
+ *   The string is owned by the dialog. If you want to keep a reference
  *   to it, you have to call g_strdup() on it.
  */
 const gchar *
@@ -1807,9 +1807,7 @@ gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
  * @about: a #GtkAboutDialog
  * @icon_name: (allow-none): an icon name, or %NULL
  *
- * Sets the surface to be displayed as logo in the about dialog.
- * If it is %NULL, the default window icon set with
- * gtk_window_set_default_icon() will be used.
+ * Sets the icon name to be displayed as logo in the about dialog.
  */
 void
 gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,